﻿ /*************************************************************************
File:   config.as
Author: Duykham
Date:   07/04/2009
TODO:   Define Constants in CFG_object for BKSCT.fla
/*************************************************************************/
_inc_config_as_ = 1;
trace ("#included: as/config_trans.as");
///////////////////////////////////////////////////////////////////////////
//TODO:ExternalInterface
import mx.utils.Delegate;
import com.actionscript.configuration.ConfigScript;
//Global Config var
var CFG : Object = new Object ();
var built:String = "(200904271633)";
var version:String = "";
var nameApp:String = "BK Connect Anywhere System";
var logo:String = "BKCAS";
var io=1;
this.onDataParsedHandler = function (o : Object) : Void 
{
	var myConfig : ConfigScript = o.target;
	CFG.fmsApp = myConfig.getItemValue ("CFG.fmsApp");
	CFG.rfidAdd = myConfig.getItemValue("CFG.rfidAdd");
	CFG.rfidCam = myConfig.getItemValue("CFG.rfidCam");
	CFG.autoStart =myConfig.getItemValue("CFG.autoStart");
	//CFG.loginUser = myConfig.getItemValue ("CFG.loginUser");
	//CFG.loginPass = myConfig.getItemValue ("CFG.loginPass");
	CFG.flashOnly = myConfig.getItemValue ("CFG.flashOnly");
	CFG.showInfo = myConfig.getItemValue ("CFG.showInfo");
	CFG.alarmStartTime = myConfig.getItemValue ("CFG.alarmStartTime");
	CFG.alarmStopTime = myConfig.getItemValue ("CFG.alarmStopTime");
	CFG.infoString = "<b>FMS Application:</b> " + CFG.fmsApp + "<br/>" + "<b>PHP(RFID) Address:</b> " + CFG.rfidAdd + "<br/>"+ "<b>RFID Camera (No.):</b> " + CFG.rfidCam + "<br/>"+ "<b>Auto Start:</b> " + CFG.autoStart + "<br/>"+ "<b>Flash Only:</b> " + CFG.flashOnly + "<br/>"+ "<b>Alarm start at:</b> " + CFG.alarmStartTime + "<br/>"+ "<b>Alarm stop at:</b> " + CFG.alarmStopTime + "<br/>";
}
var cs : ConfigScript = new ConfigScript ();
cs.addEventListener ("Data", Delegate.create (this, this.onDataParsedHandler));
cs.load ("config/transmit.cs");

//Show Info button
info_btn.onRollOver = function()
{
	//trace ("_root.CFG.showInfo: " + _root.CFG.showInfo);
	if (_root.CFG.showInfo == 1)
	{
		trace ("if (_root.CFG.showInfo)");
		//_root.info_txt._visible = true;
		//_root.info_txt.text = _root.CFG.infoString;
		toolTip.show (_root.CFG.infoString, 500, 110, 25, 470);
	}
	else
	{
		//do nothing
	};
};
//Roll out
info_btn.onRollOut = function()
{
		//_root.info_txt._visible = false;
		toolTip.hide();
};